#include "instructionswindow.h"
#include<QApplication>
#include<QStyle>

instructionswindow::instructionswindow(QWidget*parent):QWidget(parent) {
    //窗口属性
    setWindowTitle("游戏说明");
    setFixedSize(800,600);

    //初始化组件
    returnButton=new QPushButton("返回菜单",this);
    //布局设置
    QVBoxLayout*layout=new QVBoxLayout(this);//布局管理器，将按钮按顺序排列
    layout->addStretch();
    layout->addWidget(returnButton);

    QPixmap bg(":/images/gameinstruction.png");
    if(!bg.isNull()){
        QPalette palette;
        palette.setBrush(QPalette::Window,bg.scaled(size(),Qt::KeepAspectRatioByExpanding));
        setPalette(palette);
        setAutoFillBackground(true);
    }

    //连接信号
    connect(returnButton,&QPushButton::clicked,this,&instructionswindow::returnToMenu);

}
void instructionswindow::returnToMenu()
{
    emit backToMenuRequested();
    close();
}
